﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data;
using MySql.Data.MySqlClient;

namespace WindowsFormsApplication1
{
    public partial class myjx : Form
    {
        private string staffid = "";
        private string staffname = "";
        public myjx()
        {
            InitializeComponent();
        }
        public void set_value(string staffid, string staffname)
        {
            this.staffid = staffid;
            this.staffname = staffname;
        }
        private void myjx_Load(object sender, EventArgs e)
        {
            load_data();
        }
        private void load_data()
        {
            string connection;
            string query;
            DataSet myds;
            connection = dbutils.constr;
            query = "select * from jx where staffid='"+staffid+"'";
            MySqlConnection conn = new MySqlConnection(connection);
            MySqlDataAdapter adapter = new MySqlDataAdapter();
            conn.Open();
            adapter.SelectCommand = new MySqlCommand(query, conn);
            myds = new DataSet();
            adapter.Fill(myds, "Bill");
            bindingSource1.DataSource = myds.Tables["Bill"];
            dataGridView1.DataSource = bindingSource1;
            dataGridView1.Columns["checkin_num"].HeaderText = "签到天数总计";
            dataGridView1.Columns["staffid"].HeaderText = "员工编号";
            dataGridView1.Columns["staffname"].HeaderText = "员工姓名";
            dataGridView1.Columns["leave_num"].HeaderText = "请假天数总计";
            dataGridView1.Columns["px_grade"].HeaderText = "培训分数";
            dataGridView1.Columns["pj_grade"].HeaderText = "评价分数";
            conn.Close();


        }
    }
}
